package com.mall.shopping.converter;

import com.mall.shopping.dal.entitys.Item;
import com.mall.shopping.dto.ProductDetailDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @description:
 * @author 岳子昂
 * @date 2022-01-20 14:28
 * @version 1.0
 */
@Mapper( componentModel = "spring")
public interface ProductDetailConverter {
    @Mappings({
            @Mapping(source = "id", target = "productId"),
            @Mapping(source = "price", target = "salePrice"),
            @Mapping(source = "title", target = "productName"),
            @Mapping(source = "sellPoint", target = "subTitle"),
            @Mapping(source = "limitNum", target = "limitNum"),
            @Mapping(source = "imageBig", target = "productImageBig")
    })
    ProductDetailDto item2ProducrdetailDto (Item item);
}
